/**
 * 文章相关API
 */

import {
	http,
	Method
} from '@/utils/request.js';
import api from '@/config/api.js';

/**
 * 获取某个分类的文章列表
 * @param category_type 文章分类
 */
export function getArticleCategory(category_type) {
	return http.request({
		url: `${api.base}/pages/article-categories`,
		method: Method.GET,
		params: {
			category_type
		},
	});
}

/**
 * 获取文章详情
 * @param id 文章id
 */
export function getArticleDetail(id) {
	return http.request({
		url: `/other/article/get/${id}`,
		method: Method.GET,
	});
}

/**
 * 获取文章详情
 * @param type 文章类型
 */
export function getArticleDetailByType(type) {
	return http.request({
		url: `/other/article/type/${type}`,
		method: Method.GET,
	});
}